<%--
  Created by IntelliJ IDEA.
  User: yale
  Date: 2017/10/20
  Time: 15:11
  s标签和c标签遍历的区别.
--%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix = "s" uri = "/struts-tags" %>
<%@ taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

</head>
<body>
<%-- 首页
欢迎您:${sessionScope.CURRENT_USER } --%>
<s:if test = "#session.CURRENT_USER=='zhang'">
    00
</s:if>
<s:else>
    11
</s:else>

<!-- jstl el -->
<c:if test="${sessionScope.CURRENT_USER eq 'zhang' }">
    jstl&el用户${CURRENT_USER }
</c:if>

<!-- jstl遍历集合 -->
<c:forEach items="${list }" var="ls" varStatus="vs">
    ${ls }\\${vs.index }
</c:forEach>
<!-- st只能从servlet里拿,所以需要加# -->
<s:iterator value="list" id="ls" status="st">
    <s:property value="ls"/>\\<s:property value="#st.index"/>
</s:iterator>

</body>
</html>
